package demo.activity;

import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import demo.zandroid.R;

public class PointAmin extends Activity {
	private ImageView iv,iv_chick;
	private AnimationDrawable animationDrawable;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_point);
		iv = (ImageView) findViewById(R.id.iv);
		iv.setImageResource(R.drawable.point_list);  
        animationDrawable = (AnimationDrawable) iv.getDrawable();  
        animationDrawable.start();
        
        iv_chick = (ImageView) findViewById(R.id.iv_chick);
        iv_chick.setImageResource(R.drawable.chick_list);
        animationDrawable = (AnimationDrawable) iv_chick.getDrawable();
        animationDrawable.start();
        
        iv_chick.postDelayed(new Runnable() {
			
			@Override
			public void run() {
				iv_chick.clearAnimation();
				animationDrawable = null;
				iv_chick.setVisibility(View.GONE);
			}
		}, 2000);
        
        iv_chick.postDelayed(new Runnable() {
			
			@Override
			public void run() {
				iv_chick.setVisibility(View.VISIBLE);
				iv_chick.setImageResource(R.drawable.chick_list);
		        animationDrawable = (AnimationDrawable) iv_chick.getDrawable();
		        animationDrawable.start();
			}
		}, 40000);
	}
}
